<?php
 
function loginFunction()
{
    
    
             if (isset($_SESSION['logged']))
             {
                 
                 if($_SESSION['logged']==true)
                 {
?>

<html>
<head>
</head>
<body>
<div class="well well span6 offset6">
	<div class="alert alert-success span5">				
			<button type="button" class="close" data-dismiss="alert">×</button>
			<?php echo 'Zalogowałeś się jako '.$_SESSION['name']; ?>
	</div>	
	<div class="span7">	
		<form action="upload.php" method="POST" enctype="multipart/form-data">
	
			<input type="file" name="my_little_file"/>
			<input type="submit"/>
		</form>
	</div>
		<div>
			<form action="transforms.php" class="form-inline span6" method="GET">
			<input type="text" name="action"/>
			<input type="submit"/>
			</form>
		</div>
			<form action="index.php" class="span3"  method="POST">
			<input type="submit" name="logout" value="Wyloguj"/>
			</form>
</div>


		<?php
		$iter = new DirectoryIterator('files');
		$files = array();
		$directories = array();
		foreach($iter as $item) {
			if($item->isFile()) {
			$files[] = $item->getFilename();
			} else if ($item->isDir()) {
			$directories[] = $item->getPathname();
			}
		}
		
		foreach($files as $image)
		{
		//print_r($image);
		echo "<img src='files/$image'>" ;
		}
		
                 }
             }
}
?>


	<script src="js/jquery-1.8.2.min.js"></script>
	<script src="js/bootstrap.js"></script>
</body>
</html>
	

